function initForm(form, devTradeNo, formName, index) {
    $.ajax({
        url: "/log/trade/queryTradeInfo",
        data: {id: devTradeNo},
        type: "GET",
        success: function (data) {
            if (data.code == 0) {
                var tradeInfo = data.data;
                var function_='';
                if (tradeInfo.function==='TRADE'){function_='支付'}
                if (tradeInfo.function==='REFUND'){function_='退款'}
                if (tradeInfo.function==='QUERY'){function_='查询'}
                if (tradeInfo.function==='RECHARGE'){function_='充值'}
                //表单初始赋值
                form.val(formName, {
                    "logId":tradeInfo.id,
                    "legalPersonCode": tradeInfo.legalPersonCode,
                    "devSn": tradeInfo.devSn,
                    "devTradeNo": tradeInfo.devTradeNo,
                    "function": function_,
                    "inParam": tradeInfo.inString,
                    "inTime": tradeInfo.inTime,
                    "outParam":tradeInfo.outString,
                    "outTime": tradeInfo.outTime,
                    "contains": tradeInfo.contains
                });
            } else {
                parent.layer.msg(data.msg, {icon: 5, anim: 6, time: 3000}, function () {
                    parent.layer.close(index);//关闭layer
                });
            }
        },
        error:function () {
            parent.layer.msg('系统异常，请稍后重试！', {icon: 5, anim: 6, time: 3000});
            parent.layer.close(index);
        }
    });
}
function initServiceForm(form, id, formName, index) {
    $.ajax({
        url: "/log/system/serviceInfo",
        data: {id: id},
        type: "GET",
        success: function (data) {
            if (data.code == 0) {
                
                var leval='';
                var serviceInfo = data.data;
               if (serviceInfo.logLevel==0){
                    leval='debug'
               }
                if (serviceInfo.logLevel==1){
                    leval='info'
                }
                if (serviceInfo.logLevel==2){
                    leval='warn'
                }if (serviceInfo.logLevel==3){
                    leval='error'
                }

                //表单初始赋值
                form.val(formName, {
                    "serviceName": serviceInfo.serviceName,
                    "logLevel": leval,
                    "createTime": serviceInfo.createTime,
                    "logTime": serviceInfo.logTime,
                    "content": serviceInfo.contentString
                });
            } else {
                parent.layer.msg(data.msg, {icon: 5, anim: 6, time: 3000}, function () {
                    parent.layer.close(index);//关闭layer
                });
            }
        },
        error:function () {
            parent.layer.msg('系统异常，请稍后重试！', {icon: 5, anim: 6, time: 3000});
            parent.layer.close(index);
        }
    });
}

